
<div class="doc-example container-fluid am-comment-success" >

  {%if obj.session.webStatus %}
   <a href="/account/profile/{{obj.session.userId}}/">
  <img src="{{obj.session.portraitUri}}" alt="" class="am-comment-avatar" width="50" height="50"/>
</a>


  <div class="am-comment-main"  style="width:80%">
    <header class="am-comment-hd">
      <!--<h3 class="am-comment-title">评论标题</h3>-->
      <div class="am-comment-meta">
        <a href="/account/profile/{{obj.session.userId}}/" class="am-comment-author">
          我
        </a>
        也来评论
      </div>
    </header>

      {%else%}
<a href="/account/login_page/">
      <img src="/static/default/pic/default_nopic.png" alt="" class="am-comment-avatar" width="50" height="50"/>
</a>


  <div class="am-comment-main"  style="width:75%">
    <header class="am-comment-hd">
      <!--<h3 class="am-comment-title">评论标题</h3>-->
      <div class="am-comment-meta">
        <a href="/account/login_page/" class="am-comment-author">
          我
        </a>
        也来评论
      </div>
    </header>

      {% endif %}

    <div class="am-comment-bd">
      <div class="am-u-md-12">
        <form name="comment_form" id="comment_form"  method="POST" action="./comment/addition/">
          <div class="am-g">
            <textarea
                class="textarea_100"
                style="width:100%"
                name="comment_textarea"
                id="comment_textarea"
                rows="4"
                 placeholder="最多250字" ></textarea>
          </div>
          <ul class="am-nav">
            <li>
            <div id="tip" >
            </div>

            <li>
              {%if obj.session.webStatus %}
            <a class="am-btn am-btn-warning am-u-md-2" href="javascript:submitForm();">
              评论
            </a>
              {% else %}
              <a class="am-btn am-btn-warning am-u-md-2" href="javascript:loginFirst();">
              评论
            </a>
              {% endif %}
          </ul>
          {% csrf_token %}
        </form>
      </div>

      <script>
        function loginFirst(){
            alert('请先登录！');
            window.location.href = '/account/login_page/';
        }

        function submitForm(){
          if($("#comment_textarea").val()==""){
            $("#tip").html("<font color='red'>不能为空！</font>");
            return;
          }
          $("#comment_form").submit();
        }
      </script>
    </div>
  </div>
</div>

<!--<div align="center">-->
  <!--<font color="red">-->
    <!--若想评论，请先登录-->

  <!--</font>-->
<!--</div>-->

<br>
    </div>

